package com.nineclock.sign.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.sign.pojo.SignInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SignInfoMapper extends BaseMapper<SignInfo> {
    @Select("SELECT DISTINCT company_user_id FROM sign_info WHERE company_id = #{companyId} AND create_date BETWEEN #{startTime} AND #{endTime} limit #{pageStart} , #{pageSize};")
    List<Long> findCompanyUserIdPageByDate(@Param("startTime")String startTime,@Param("endTime") String endTime,@Param("pageStart") Long pageStart,@Param("pageSize") Long pageSize,@Param("companyId") Long companyId);

    @Select("SELECT DISTINCT company_user_id FROM sign_info WHERE company_id = #{companyId} AND create_date BETWEEN #{startTime} AND #{endTime}")
    List<Long> findCompanyUserIdByDate(@Param("startTime")String startTime,@Param("endTime") String endTime,@Param("companyId") Long companyId);
}
